/**
 * 
 */
package com.nwpusp.model.location;

import java.io.Serializable;

import com.nwpusp.model.Entity;

/**
 * @author JustinCao
 *
 */
public abstract class _3DConcept implements Serializable, Cloneable {
	protected int xConcept = 0;
	protected int yConcept = 0;
	protected int zConcept = 0;
	
	private int[] intArray = new int[3];
	
	public int[] getIntArray() {
		intArray[0] = xConcept;
		intArray[1] = yConcept;
		intArray[2] = zConcept;
		return intArray;
	}
	
	@Override
	public Object clone() {
		Object o = null;
		try {
			o = super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return o;
	}
	
	public _3DConcept(int xConcept, int yConcept, int zConcept) {
		this.xConcept = xConcept;
		this.yConcept = yConcept;
		this.zConcept = zConcept;
	}
	
	public _3DConcept Plus(int dx, int dy, int dz) {
		xConcept += dx;
		yConcept += dy;
		zConcept += dz;
		return this;
	}
	
	protected _3DConcept Plus(_3DConcept p) {
		xConcept += p.xConcept;
		yConcept += p.yConcept;
		zConcept += p.zConcept;
		return this;
	}
	
	protected _3DConcept Substract(_3DConcept s) {
		xConcept -= s.xConcept;
		yConcept -= s.yConcept;
		zConcept -= s.zConcept;
		return this;
	}
	public int getX() {
		return xConcept;
	}
	public int getY() {
		return yConcept;
	}
	public int getZ() {
		return zConcept;
	}
}
